import React from "react";
import { Tag } from "antd";
import "./TaskItem.less";

// 数据类型
interface TaskItemProps {
  id: string;
  title: string;
  date: string;
  description: string;
  status: {
    color: string;
    text: string;
  };
}

const TaskItem: React.FC<TaskItemProps> = ({ title, date, description, status }) => {
  // 用于调试 props
  // console.log({ title, date, description, status });
  return (
    <div className="task-item">
      <Tag className="task-icon" color={status.color}>
        {status.text}
      </Tag>
      <div className="task-content">
        <div className="task-title">{title}</div>
        <Tag className="task-date">{date}</Tag>
        <div className="task-description">{description} </div>
      </div>
      <div className="task-actions">查看</div>
    </div>
  );
};

export default TaskItem;
